#ifndef UTILS_H
#define UTILS_H

#include <linux/rhashtable.h>
#include <linux/slab.h>

void hash_entry_free(void *ptr, void *arg);
#define rhashtable_free_and_destroy_m(rhashtable) rhashtable_free_and_destroy(rhashtable, hash_entry_free, NULL);

void Kfree(const void *p);
void *Kzalloc(size_t size);

void dumpArray(char arr[], int size);

/**
 * DBG
*/
void init_DBG(void);
extern int *DBG_VALID_LIST;
enum {
    DBG_READ_DEDUP,
    DBG_WRITE_DEDUP,
    DBG_LRU_LIST
};
#define DBG(type, fmt, ...) if(DBG_VALID_LIST[type]){pr_alert(fmt, ##__VA_ARGS__);}

#endif /* UTILS_H */